<template>
	<div>
    <div class="flex">
      <div style="flex: 1; height: 100vh;  background-size: cover;" class="beijingtu"></div>
      <div class="flexcc" style="flex: 1;">
        <div>
          <div><img src="../../static/img/xiaoluohao.png"></div>
          <div class="flexcc" style="margin: 20px 0 40px; font-size: 28px; font-weight: bold;">管理后台</div>
          <div class="t_input_box">
          	<img src="../../static/img/user.png" alt="">
          	<el-input class="t_del_com_input" v-model="form.name" placeholder="账号名称"></el-input>
          </div>
          <div class="t_input_box">
          	<img src="../../static/img/psd.png" alt="">
          	<el-input class="t_del_com_input" v-model="form.password" placeholder="请输入密码" show-password></el-input>
          </div>
          <div @click="loginorreg" class="t_login_btn_box">
          		登录
          </div>
        </div>
      </div>
    </div>
	</div>
</template>

<script>
	export default {
		name: 'top',
		data() {
			return {
        form:{
          name:"",
          password:""
        }
			}
		},
		created() {


		},
		mounted() {

		},
		methods: {
      loginorreg:function(){

        axios.post('/plat/login',this.form).then((response)=>{
        	if (response.data.msg.code == 0) {
            localStorage.setItem('guanliyuan',JSON.stringify(response.data.data))
        		this.$message({
        			message: '登录成功',
        			type: 'success'
        		});
            this.$router.push('/dianpu')
        	} else {
        		this.$message.error(response.data.msg.info);
        	}
        })
      }
		}
	}
</script>


<style scoped >
  .t_input_box{
  	border: 1px solid #e3e8f1;
  	border-radius: 25px;
  	display: flex;
  	height: 46px;
  	align-items: center;
  	background-color: white;
  	overflow: hidden;
  	margin-bottom: 20px;
  }
  .t_input_box img{
  	margin-left: 22px;
  	margin-right: 0px;
  }
  /deep/.t_input_box .el-input__inner{
  	border: none;
    background: #fff !important;
    border: 1px solid #fff !important;
  }

  .t_login_btn_box{
  	background-color:#005aff;
  	color: white;
  	text-align: center;
  	height: 50px;
  	line-height: 50px;
  	font-size: 18px;
  	border-radius: 25px;
  	margin-top: 60px;
  	cursor: pointer;
  }
  .beijingtu{background: url('../../static/img/banner.png');}
</style>
